import Vue from 'vue'
import { getLang } from '@/utils/auth'
import VueI18n from 'vue-i18n'
import Chinese from './Chinese.js'
import TraditionalChinese from './TraditionalChinese.js'
import English from './English.js'
import Korean from './Korean.js'
import Japanese from './Japanese.js'

Vue.use(VueI18n)

const messages = {
  Korean: { language: '한국어', ...Korean },
  Chinese: { language: '简体中文', ...Chinese },
  TraditionalChinese: { language: '繁體中文', ...TraditionalChinese },
  English: {
    language: 'English',
    ...English
  },
  Japanese: { language: '日本語', ...Japanese }
}
const i18n = new VueI18n({
  locale: getLang() || 'Korean',
  messages: messages
})
Vue.prototype._i18n = i18n
export { i18n, messages }
